//
//  YCCourseFourViewController.m
//  YCSchool
//
//  Created by yanglinxia on 16/4/26.
//  Copyright © 2016年 yanglinxia. All rights reserved.
//  科目四

#import "YCCourseFourViewController.h"
#import "YCExamBaseTableView.h"
#import "YCTitleCell.h"
#import "YCExamStrategyCell.h"
#import "YCTeachVideoCell.h"
#import "YCExamStatusCell.h"

@interface YCCourseFourViewController ()
/**第一组*/
@property(nonatomic,strong)NSArray *section1;
/**第二组*/
@property(nonatomic,strong)NSArray *section2;
/**第三组*/
@property(nonatomic,strong)NSArray *section3;
@end

@implementation YCCourseFourViewController
- (NSArray *)section1{
    if (!_section1) {
        // 每一个section显示的cell
        YCExamStatusCell *statusCell = [[YCExamStatusCell alloc]init];
        _section1 = @[statusCell];
    }
    
    return _section1;
}

- (NSArray *)section2{
    if (!_section2) {
        YCTitleCell *titleCell = [[YCTitleCell alloc]init];
        titleCell.leftLabelText = @"考试攻略";
        YCExamStrategyCell *strategyCell = [[YCExamStrategyCell alloc]init];
        _section2 = @[titleCell,strategyCell];
    }
    
    return _section2;
}

-(NSArray *)section3{
    if (!_section3) {
        YCTitleCell *titleCell = [[YCTitleCell alloc]init];
        titleCell.leftLabelText = @"视频教学";
        titleCell.rightLabelText = @"查看更多";
        YCTeachVideoCell *teachCell = [[YCTeachVideoCell alloc]init];
        _section3 = @[titleCell,teachCell];
    }
    
    return _section3;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupChildViews];
}

- (void)setupChildViews{
    
    // 每个section显示的数据
    NSMutableArray *sectionGroup = [NSMutableArray array];
    [sectionGroup addObject:self.section1];
    [sectionGroup addObject:self.section2];
    [sectionGroup addObject:self.section3];
    
    YCExamBaseTableView *tableView = [[YCExamBaseTableView alloc]initWithFrame:self.view.bounds];
    [self.view addSubview:tableView];
    
    tableView.sectionGroup = sectionGroup;
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
